package com.sunrise.xdoc.utils;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang3.SerializationUtils;

public final class SunriseCollectionUtils {
	private SunriseCollectionUtils() {
	}

	public static <T extends Serializable> Collection<T> clone(Collection<T> collection) {
		Set<T> s = new HashSet<>(collection.size());
		for (T t : collection) {
			s.add(SerializationUtils.clone(t));
		}
		return s;
	}
}
